# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.

if Rails.env.production?
  Gitlab::Application.config.action_mailer.delivery_method = :smtp

  ActionMailer::Base.smtp_settings = {
    <% unless @smtp_authentication.nil? %>
    authentication: <%= @smtp_authentication.to_s.to_sym.inspect %>,
    <% end %>
<% %w{ address port user_name password domain enable_starttls_auto tls ssl openssl_verify_mode ca_path ca_file }.each do |key| %>
  <% value = node['gitlab']['gitlab-rails']["smtp_#{key}"] %>
    <%= "#{key}: #{value.inspect}," unless value.nil? %>
<% end %>
  }
end
